package com.cloud.async.result.core.handler;

import com.cloud.async.result.core.AsyncResult;
import com.cloud.async.result.core.body.ResultBody;

import java.util.function.Function;

public class DefaultAsyncResultHandlerWrapper implements AsyncResult {

    private AsyncResult delegate;

    public DefaultAsyncResultHandlerWrapper( AsyncResult delegate) {
        this.delegate = delegate;
    }

    @Override
    public <T> ResultBody<T> getResult(String taskId, Class<T> responseType) {
        return delegate.getResult(taskId, responseType);
    }

    @Override
    public <T, R> ResultBody<R> getResult(String taskId, Class<T> responseType, Function<T, R> converter) {
        return delegate.getResult(taskId, responseType, converter);
    }

    @Override
    public <T> ResultBody<T> getResult(String taskId, Long milliSecond, Class<T> responseType) {
        return delegate.getResult(taskId, milliSecond, responseType);
    }

    @Override
    public <T, R> ResultBody<R> getResult(String taskId, Long milliSecond, Class<T> responseType, Function<T, R> converter) {
        return delegate.getResult(taskId, milliSecond, responseType, converter);
    }
}
